

package com.maoshi.shop.distribution.comment.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.maoshi.shop.distribution.comment.dto.AchievementDataDto;
import com.maoshi.shop.distribution.comment.dto.DistributionUserAchievementDataDto;
import com.maoshi.shop.distribution.comment.dto.DistributionUserSimpleDto;
import com.maoshi.shop.distribution.comment.model.DistributionUser;
import com.maoshi.shop.distribution.comment.param.RangeTimeParam;
import org.apache.ibatis.annotations.Param;


public interface DistributionUserMapper extends BaseMapper<DistributionUser> {

//    String getParentIdsByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

    AchievementDataDto getAchievementDataDtoById(Long id);

    IPage<DistributionUser> distributionUserPage(Page page, @Param("distributionUser") DistributionUser distributionUser, @Param("rangeTimeParam") RangeTimeParam rangeTimeParam, @Param("mobile") String mobile, @Param("parentMobile") String parentMobile);

    IPage<DistributionUser> getDistributionUserAchievementPage(Page page, @Param("distributionUser") DistributionUser distributionUser, @Param("userMobile") String userMobile);

    DistributionUserAchievementDataDto getLevelDistributionUserAchievementDataByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

//    Long getParentDistributionUserIdByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

//    String getUserIdByDistributionUserId(@Param("distributionUserId") Long distributionUserId);

    IPage<DistributionUserSimpleDto> getDistributionUserSimpleDtoByParentUserIdPage(Page page, @Param("parentDistributionUserId") Long parentDistributionUserId);

    /**
     * 修改等级
     */
    void updateLevel(@Param("distributionUserId") Long distributionUserId, @Param("level") Integer level);

    void replaceLevel(@Param("shopId") Long shopId, @Param("maxLevel") int maxLevel);

//     int getLevelIdByDistributionUserId(Long distributionUserId);
}
